import { SET_LIST, DEL_LIST, ADD_LIST } from './actionsType'
import { getList } from '../api'

export function setList() {
	return async dispatch => {
		const resp = await getList()
		dispatch({ type: SET_LIST, payload: resp.data.data })
	}
}

export function delList(payload) {
	return { type: DEL_LIST, payload }
}

export function addList(payload) {
	return { type: ADD_LIST, payload }
}